<template>
	<view>
		<view class="videos">
			<view class="video" v-for="(item,i) in videos" :key="i">
				<view class="title">
					{{item.title}}
				</view>
				<video :src=item.src loop='true' muted='true' autoplay='true' initial-time='3' :controls="false" object-fit="fill"
					@click="govideo(item.id)">
				</video>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				show:false,
				videos: [],
			};
		},
		onLoad() {
			this.getvedio()
		},
		methods: {
			async getvedio() {
				const datas = await uni.$http.get('/cantlogin/getAllVedioData')
				if (datas.statusCode !== 200) return uni.$showMsg()
				this.videos=datas.data
			},
			govideo(id) {
				uni.navigateTo({
					url: '../BrushVideo/BrushVideo?id=' + id
				})
			},
		},

	}
</script>

<style lang="less">
	.videos {
		padding: 15rpx;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;

		.video {
			border: 2rpx solid black;
			border-radius: 15rpx;
			// background-color: #feeeed;
			margin-bottom: 10rpx;

			.title {
				text-align: center;
				color: red;
				padding: 10rpx;
			}

			video {
				width: 350rpx;
				margin-bottom: 15rpx;
			}
		}


	}
</style>
